﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Globalization;
using System.Drawing;
using SQLServerHealthCheck.Model;
using System.Collections.ObjectModel;
using System.Windows.Media.Imaging;

namespace SQLServerOptimizer.PL.WPF
{
    
    
    public class SeverityToColorConverter:IValueConverter
    {
       

        public object Convert(object value, Type targetType,object parameter, CultureInfo culture)
        {
            if (value != null)
            {

                int severity = (int)value;

                if (severity == 1)
                {
                    BitmapImage image = new BitmapImage();
                    image.BeginInit();
                    image.UriSource = new Uri("/SQLServerOptimizer.PL.WPF;component/Images/add.png", UriKind.Relative);
                    image.EndInit();

                    return image;
                }
                else if (severity == 2)
                {
                    BitmapImage image = new BitmapImage();
                    image.BeginInit();
                    image.UriSource = new Uri("/SQLServerOptimizer.PL.WPF;component/Images/add.png", UriKind.Relative);
                    image.EndInit();

                    return image;
                }
                else 
                {
                    BitmapImage image = new BitmapImage();
                    image.BeginInit();
                    image.UriSource = new Uri("/SQLServerOptimizer.PL.WPF;component/Images/add.png", UriKind.Relative);
                    image.EndInit();

                    return image;
                
                }
                
            }
            return value;
        }

        public object ConvertBack(object value, Type targetType,
           object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

       
    }
}
